package com.bite.demo;

import com.bite.demo.component.UserComponent;
import com.bite.demo.config.UserConfig;
import com.bite.demo.controller.UserController;
import com.bite.demo.model.UserInfo;
import com.bite.demo.repository.UserRepository;
import com.bite.demo.service.UserService;
import org.apache.catalina.User;
import org.apache.catalina.core.ApplicationContext;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Application {

	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
		UserController userController = context.getBean(UserController.class);
		userController.sayHi();
//		UserInfo userInfo1 = (UserInfo) context.getBean("u1");
//		UserInfo userInfo2 = (UserInfo) context.getBean("user1");
//		System.out.println(userInfo1);
//		System.out.println(userInfo2);
//		UserConfig userConfig = context.getBean(UserConfig.class);
//		userConfig.sayHi();
//		UserComponent userComponent = context.getBean(UserComponent.class);
//		userComponent.sayHi();
//		UserRepository userRepository = context.getBean(UserRepository.class);
//		userRepository.sayHi();
//		UserService userService = context.getBean(UserService.class);
//		userService.sayHi();
		/*UserController userController1 = context.getBean(UserController.class);
		userController1.sayHi();
		UserController userController2 = (UserController) context.getBean("userController");
		userController2.sayHi();
		UserController userController3 = context.getBean("userController", UserController.class);
		userController3.sayHi();
		System.out.println(userController1);
		System.out.println(userController2);
		System.out.println(userController3);*/


	}

}
